home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / AppleTalk.h < prev    next >
Text File  |  1995-07-06  |  38KB  |  1,155 lines

  1. /*
  2.      File:        AppleTalk.h
  3.  
  4.      Contains:    AppleTalk Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __APPLETALK__
  21. #define __APPLETALK__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __OSUTILS__
  30. #include <OSUtils.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <Memory.h>                                            */
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=mac68k
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT_SUPPORTED
  44. #pragma import on
  45. #endif
  46.  
  47.  
  48. enum {
  49. /* Driver unit and reference numbers (ADSP is dynamic) */
  50.     mppUnitNum                    = 9,                            /* MPP unit number */
  51.     atpUnitNum                    = 10,                            /* ATP unit number */
  52.     xppUnitNum                    = 40,                            /* XPP unit number */
  53.     mppRefNum                    = -10,                            /* MPP reference number */
  54.     atpRefNum                    = -11,                            /* ATP reference number */
  55.     xppRefNum                    = -41,                            /* XPP reference number */
  56. /* .MPP csCodes */
  57.     lookupReply                    = 242,                            /* This command queued to ourself */
  58.     writeLAP                    = 243,                            /* Write out LAP packet */
  59.     detachPH                    = 244,                            /* Detach LAP protocol handler */
  60.     attachPH                    = 245,                            /* Attach LAP protocol handler */
  61.     writeDDP                    = 246,                            /* Write out DDP packet */
  62.     closeSkt                    = 247,                            /* Close DDP socket */
  63.     openSkt                        = 248,                            /* Open DDP socket */
  64.     loadNBP                        = 249,                            /* Load NBP command-executing code */
  65.     lastResident                = 249,                            /* Last resident command */
  66.     confirmName                    = 250,                            /* Confirm name */
  67.     lookupName                    = 251,                            /* Look up name on internet */
  68.     removeName                    = 252,                            /* Remove name from Names Table */
  69.     registerName                = 253,                            /* Register name in Names Table */
  70.     killNBP                        = 254                            /* Kill outstanding NBP request */
  71. };
  72.  
  73. enum {
  74.     unloadNBP                    = 255,                            /* Unload NBP command code */
  75.     setSelfSend                    = 256,                            /* MPP: Set to allow writes to self */
  76.     SetMyZone                    = 257,                            /* Set my zone name */
  77.     GetATalkInfo                = 258,                            /* get AppleTalk information */
  78.     ATalkClosePrep                = 259,                            /* AppleTalk close query */
  79. /* .ATP csCodes */
  80.     nSendRequest                = 248,                            /* NSendRequest code */
  81.     relRspCB                    = 249,                            /* Release RspCB */
  82.     closeATPSkt                    = 250,                            /* Close ATP socket */
  83.     addResponse                    = 251,                            /* Add response code | Require open skt */
  84.     sendResponse                = 252,                            /* Send response code */
  85.     getRequest                    = 253,                            /* Get request code */
  86.     openATPSkt                    = 254,                            /* Open ATP socket */
  87.     sendRequest                    = 255,                            /* Send request code */
  88.     relTCB                        = 256,                            /* Release TCB */
  89.     killGetReq                    = 257,                            /* Kill GetRequest */
  90.     killSendReq                    = 258,                            /* Kill SendRequest */
  91.     killAllGetReq                = 259,                            /* Kill all getRequests for a skt */
  92. /* .XPP csCodes */
  93.     openSess                    = 255,                            /* Open session */
  94.     closeSess                    = 254,                            /* Close session */
  95.     userCommand                    = 253                            /* User command */
  96. };
  97.  
  98. enum {
  99.     userWrite                    = 252,                            /* User write */
  100.     getStatus                    = 251,                            /* Get status */
  101.     afpCall                        = 250,                            /* AFP command (buffer has command code) */
  102.     getParms                    = 249,                            /* Get parameters */
  103.     abortOS                        = 248,                            /* Abort open session request */
  104.     closeAll                    = 247,                            /* Close all open sessions */
  105.     xCall                        = 246,                            /* .XPP extended calls */
  106. /* Transition Queue transition types */
  107.     ATTransOpen                    = 0,                            /*AppleTalk has opened*/
  108.     ATTransClose                = 2,                            /*AppleTalk is about to close*/
  109.     ATTransClosePrep            = 3,                            /*Is it OK to close AppleTalk ?*/
  110.     ATTransCancelClose            = 4,                            /*Cancel the ClosePrep transition*/
  111.     afpByteRangeLock            = 1,                            /*AFPCall command codes*/
  112.     afpVolClose                    = 2,                            /*AFPCall command codes*/
  113.     afpDirClose                    = 3,                            /*AFPCall command codes*/
  114.     afpForkClose                = 4,                            /*AFPCall command codes*/
  115.     afpCopyFile                    = 5,                            /*AFPCall command codes*/
  116.     afpDirCreate                = 6,                            /*AFPCall command codes*/
  117.     afpFileCreate                = 7,                            /*AFPCall command codes*/
  118.     afpDelete                    = 8,                            /*AFPCall command codes*/
  119.     afpEnumerate                = 9                                /*AFPCall command codes*/
  120. };
  121.  
  122. enum {
  123.     afpFlush                    = 10,                            /*AFPCall command codes*/
  124.     afpForkFlush                = 11,                            /*AFPCall command codes*/
  125.     afpGetDirParms                = 12,                            /*AFPCall command codes*/
  126.     afpGetFileParms                = 13,                            /*AFPCall command codes*/
  127.     afpGetForkParms                = 14,                            /*AFPCall command codes*/
  128.     afpGetSInfo                    = 15,                            /*AFPCall command codes*/
  129.     afpGetSParms                = 16,                            /*AFPCall command codes*/
  130.     afpGetVolParms                = 17,                            /*AFPCall command codes*/
  131.     afpLogin                    = 18,                            /*AFPCall command codes*/
  132.     afpContLogin                = 19,                            /*AFPCall command codes*/
  133.     afpLogout                    = 20,                            /*AFPCall command codes*/
  134.     afpMapID                    = 21,                            /*AFPCall command codes*/
  135.     afpMapName                    = 22,                            /*AFPCall command codes*/
  136.     afpMove                        = 23,                            /*AFPCall command codes*/
  137.     afpOpenVol                    = 24,                            /*AFPCall command codes*/
  138.     afpOpenDir                    = 25,                            /*AFPCall command codes*/
  139.     afpOpenFork                    = 26,                            /*AFPCall command codes*/
  140.     afpRead                        = 27,                            /*AFPCall command codes*/
  141.     afpRename                    = 28,                            /*AFPCall command codes*/
  142.     afpSetDirParms                = 29                            /*AFPCall command codes*/
  143. };
  144.  
  145. enum {
  146.     afpSetFileParms                = 30,                            /*AFPCall command codes*/
  147.     afpSetForkParms                = 31,                            /*AFPCall command codes*/
  148.     afpSetVolParms                = 32,                            /*AFPCall command codes*/
  149.     afpWrite                    = 33,                            /*AFPCall command codes*/
  150.     afpGetFlDrParms                = 34,                            /*AFPCall command codes*/
  151.     afpSetFlDrParms                = 35,                            /*AFPCall command codes*/
  152.     afpDTOpen                    = 48,                            /*AFPCall command codes*/
  153.     afpDTClose                    = 49,                            /*AFPCall command codes*/
  154.     afpGetIcon                    = 51,                            /*AFPCall command codes*/
  155.     afpGtIcnInfo                = 52,                            /*AFPCall command codes*/
  156.     afpAddAPPL                    = 53,                            /*AFPCall command codes*/
  157.     afpRmvAPPL                    = 54,                            /*AFPCall command codes*/
  158.     afpGetAPPL                    = 55,                            /*AFPCall command codes*/
  159.     afpAddCmt                    = 56,                            /*AFPCall command codes*/
  160.     afpRmvCmt                    = 57,                            /*AFPCall command codes*/
  161.     afpGetCmt                    = 58,                            /*AFPCall command codes*/
  162.     afpAddIcon                    = 192,                            /*Special code for ASP Write commands*/
  163.     xppLoadedBit                = 5,                            /* XPP bit in PortBUse */
  164.     scbMemSize                    = 192,                            /* Size of memory for SCB */
  165.     xppFlagClr                    = 0                                /* Cs for AFPCommandBlock */
  166. };
  167.  
  168. enum {
  169.     xppFlagSet                    = 128,                            /* StartEndFlag & NewLineFlag fields. */
  170.     lapSize                        = 20,
  171.     ddpSize                        = 26,
  172.     nbpSize                        = 26,
  173.     atpSize                        = 56,
  174.     atpXOvalue                    = 32,                            /*ATP exactly-once bit */
  175.     atpEOMvalue                    = 16,                            /*ATP End-Of-Message bit */
  176.     atpSTSvalue                    = 8,                            /*ATP Send-Transmission-Status bit */
  177.     atpTIDValidvalue            = 2,                            /*ATP trans. ID valid bit */
  178.     atpSendChkvalue                = 1,                            /*ATP send checksum bit */
  179.     zipGetLocalZones            = 5,
  180.     zipGetZoneList                = 6,
  181.     zipGetMyZone                = 7,
  182.     LAPMgrPtr                    = 0xB18,                        /*Entry point for LAP Manager*/
  183.     LAPMgrCall                    = 2,                            /*Offset to LAP routines*/
  184.     LAddAEQ                        = 23,                            /*LAPAddATQ routine selector*/
  185.     LRmvAEQ                        = 24                            /*LAPRmvATQ routine selector*/
  186. };
  187.  
  188. #define MPPioCompletion MPP.ioCompletion
  189. #define MPPioResult MPP.ioResult
  190. #define MPPioRefNum MPP.ioRefNum
  191. #define MPPcsCode MPP.csCode
  192. #define LAPprotType LAP.protType
  193. #define LAPwdsPointer LAP.u.wdsPointer
  194. #define LAPhandler LAP.u.handler
  195. #define DDPsocket DDP.socket
  196. #define DDPchecksumFlag DDP.checksumFlag
  197. #define DDPwdsPointer DDP.u.wdsPointer
  198. #define DDPlistener DDP.u.listener
  199. #define NBPinterval NBP.interval
  200. #define NBPcount NBP.count
  201. #define NBPntQElPtr NBP.nbpPtrs.ntQElPtr
  202. #define NBPentityPtr NBP.nbpPtrs.entityPtr
  203. #define NBPverifyFlag NBP.parm.verifyFlag
  204. #define NBPretBuffPtr NBP.parm.Lookup.retBuffPtr
  205. #define NBPretBuffSize NBP.parm.Lookup.retBuffSize
  206. #define NBPmaxToGet NBP.parm.Lookup.maxToGet
  207. #define NBPnumGotten NBP.parm.Lookup.numGotten
  208. #define NBPconfirmAddr NBP.parm.Confirm.confirmAddr
  209. #define NBPnKillQEl NBPKILL.nKillQEl
  210. #define NBPnewSocket NBP.parm.Confirm.newSocket
  211. #define ATPioCompletion ATP.ioCompletion
  212. #define ATPioResult ATP.ioResult
  213. #define ATPuserData ATP.userData
  214. #define ATPreqTID ATP.reqTID
  215. #define ATPioRefNum ATP.ioRefNum
  216. #define ATPcsCode ATP.csCode
  217. #define ATPatpSocket ATP.atpSocket
  218. #define ATPatpFlags ATP.atpFlags
  219. #define ATPaddrBlock ATP.addrBlock
  220. #define ATPreqLength ATP.reqLength
  221. #define ATPreqPointer ATP.reqPointer
  222. #define ATPbdsPointer ATP.bdsPointer
  223. #define ATPtimeOutVal SREQ.timeOutVal
  224. #define ATPnumOfResps SREQ.numOfResps
  225. #define ATPretryCount SREQ.retryCount
  226. #define ATPnumOfBuffs OTH1.u.numOfBuffs
  227. #define ATPbitMap OTH1.u.bitMap
  228. #define ATPrspNum OTH1.u.rspNum
  229. #define ATPbdsSize OTH2.bdsSize
  230. #define ATPtransID OTH2.transID
  231. #define ATPaKillQEl KILL.aKillQEl
  232. enum {
  233.     tLAPRead,
  234.     tLAPWrite,
  235.     tDDPRead,
  236.     tDDPWrite,
  237.     tNBPLookup,
  238.     tNBPConfirm,
  239.     tNBPRegister,
  240.     tATPSndRequest,
  241.     tATPGetRequest,
  242.     tATPSdRsp,
  243.     tATPAddRsp,
  244.     tATPRequest,
  245.     tATPResponse
  246. };
  247.  
  248. typedef SInt8 ABCallType;
  249.  
  250.  
  251. enum {
  252.     lapProto,
  253.     ddpProto,
  254.     nbpProto,
  255.     atpProto
  256. };
  257.  
  258. typedef UInt8 ABProtoType;
  259.  
  260. typedef Byte ABByte;
  261.  
  262. struct LAPAdrBlock {
  263.     UInt8                            dstNodeID;
  264.     UInt8                            srcNodeID;
  265.     ABByte                            lapProtType;
  266.     UInt8                            filler;                        /*    Filler for proper byte alignment*/
  267. };
  268. typedef struct LAPAdrBlock LAPAdrBlock;
  269.  
  270. typedef struct ATQEntry ATQEntry, *ATQEntryPtr;
  271.  
  272. typedef long (*ATalkTransitionEventProcPtr)(long eventCode, ATQEntryPtr qElem, void *eventParameter);
  273.  
  274. #if GENERATINGCFM
  275. typedef UniversalProcPtr ATalkTransitionEventUPP;
  276. #else
  277. typedef ATalkTransitionEventProcPtr ATalkTransitionEventUPP;
  278. #endif
  279.  
  280. typedef ATalkTransitionEventUPP ATalkTransitionEvent;
  281.  
  282. struct ATQEntry {
  283.     ATQEntry                        *qLink;                        /*next queue entry*/
  284.     short                            qType;                        /*queue type*/
  285.     ATalkTransitionEventUPP            CallAddr;                    /*your routine descriptor*/
  286. };
  287. struct AddrBlock {
  288.     UInt16                            aNet;
  289.     UInt8                            aNode;
  290.     UInt8                            aSocket;
  291. };
  292. typedef struct AddrBlock AddrBlock;
  293.  
  294. /* 
  295.     Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  296.     offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  297.     In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  298.     only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  299.     be the same, which is OK since they are not used. 
  300. */
  301. struct EntityName {
  302.     Str32                            objStr;
  303.     SInt8                            pad1;
  304.     Str32                            typeStr;
  305.     SInt8                            pad2;
  306.     Str32                            zoneStr;
  307. };
  308. typedef struct EntityName EntityName;
  309.  
  310. typedef EntityName *EntityPtr;
  311.  
  312. struct RetransType {
  313.     UInt8                            retransInterval;
  314.     UInt8                            retransCount;
  315. };
  316. typedef struct RetransType RetransType;
  317.  
  318. struct BDSElement {
  319.     short                            buffSize;
  320.     Ptr                                buffPtr;
  321.     short                            dataSize;
  322.     long                            userBytes;
  323. };
  324. typedef struct BDSElement BDSElement;
  325.  
  326. typedef BDSElement BDSType[8];
  327.  
  328. typedef BDSElement *BDSPtr;
  329.  
  330. typedef char BitMapType;
  331.  
  332. struct ATLAPRec {
  333.     ABCallType                        abOpcode;
  334.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  335.     short                            abResult;
  336.     long                            abUserReference;
  337.     LAPAdrBlock                        lapAddress;
  338.     short                            lapReqCount;
  339.     short                            lapActCount;
  340.     Ptr                                lapDataPtr;
  341. };
  342. typedef struct ATLAPRec ATLAPRec;
  343.  
  344. typedef ATLAPRec *ATLAPRecPtr, **ATLAPRecHandle;
  345.  
  346. struct ATDDPRec {
  347.     ABCallType                        abOpcode;
  348.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  349.     short                            abResult;
  350.     long                            abUserReference;
  351.     short                            ddpType;
  352.     short                            ddpSocket;
  353.     AddrBlock                        ddpAddress;
  354.     short                            ddpReqCount;
  355.     short                            ddpActCount;
  356.     Ptr                                ddpDataPtr;
  357.     short                            ddpNodeID;
  358. };
  359. typedef struct ATDDPRec ATDDPRec;
  360.  
  361. typedef ATDDPRec *ATDDPRecPtr, **ATDDPRecHandle;
  362.  
  363. struct ATNBPRec {
  364.     ABCallType                        abOpcode;
  365.     SInt8                            filler;                        /*    Filler for proper byte alignment*/
  366.     short                            abResult;
  367.     long                            abUserReference;
  368.     EntityPtr                        nbpEntityPtr;
  369.     Ptr                                nbpBufPtr;
  370.     short                            nbpBufSize;
  371.     short                            nbpDataField;
  372.     AddrBlock                        nbpAddress;
  373.     RetransType                        nbpRetransmitInfo;
  374. };
  375. typedef struct ATNBPRec ATNBPRec;
  376.  
  377. typedef ATNBPRec *ATNBPRecPtr, **ATNBPRecHandle;
  378.  
  379. struct ATATPRec {
  380.     ABCallType                        abOpcode;
  381.     SInt8                            filler1;                    /*    Filler for proper byte alignment*/
  382.     short                            abResult;
  383.     long                            abUserReference;
  384.     short                            atpSocket;
  385.     AddrBlock                        atpAddress;
  386.     short                            atpReqCount;
  387.     Ptr                                atpDataPtr;
  388.     BDSPtr                            atpRspBDSPtr;
  389.     BitMapType                        atpBitMap;
  390.     UInt8                            filler2;                    /*    Filler for proper byte alignment*/
  391.     short                            atpTransID;
  392.     short                            atpActCount;
  393.     long                            atpUserData;
  394.     Boolean                            atpXO;
  395.     Boolean                            atpEOM;
  396.     short                            atpTimeOut;
  397.     short                            atpRetries;
  398.     short                            atpNumBufs;
  399.     short                            atpNumRsp;
  400.     short                            atpBDSSize;
  401.     long                            atpRspUData;
  402.     Ptr                                atpRspBuf;
  403.     short                            atpRspSize;
  404. };
  405. typedef struct ATATPRec ATATPRec;
  406.  
  407. typedef ATATPRec *ATATPRecPtr, **ATATPRecHandle;
  408.  
  409. struct AFPCommandBlock {
  410.     UInt8                            cmdByte;
  411.     UInt8                            startEndFlag;
  412.     short                            forkRefNum;
  413.     long                            rwOffset;
  414.     long                            reqCount;
  415.     UInt8                            newLineFlag;
  416.     char                            newLineChar;
  417. };
  418. typedef struct AFPCommandBlock AFPCommandBlock;
  419.  
  420. typedef union MPPParamBlock MPPParamBlock, *MPPPBPtr;
  421.  
  422. typedef union ATPParamBlock ATPParamBlock, *ATPPBPtr;
  423.  
  424. typedef union XPPParamBlock XPPParamBlock, *XPPParmBlkPtr;
  425.  
  426. /*
  427.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  428.         be written in or called from a high-level language without the help of
  429.         mixed mode or assembly glue.
  430.  
  431.             typedef pascal void (*MPPCompletionProcPtr)(MPPPBPtr thePBptr);
  432.  
  433.         In:
  434.          => thePBptr        A0.L
  435. */
  436. /*
  437.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  438.         be written in or called from a high-level language without the help of
  439.         mixed mode or assembly glue.
  440.  
  441.             typedef pascal void (*ATPCompletionProcPtr)(ATPPBPtr thePBptr);
  442.  
  443.         In:
  444.          => thePBptr        A0.L
  445. */
  446. /*
  447.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  448.         be written in or called from a high-level language without the help of
  449.         mixed mode or assembly glue.
  450.  
  451.             typedef pascal void (*XPPCompletionProcPtr)(XPPParmBlkPtr thePBptr);
  452.  
  453.         In:
  454.          => thePBptr        A0.L
  455. */
  456. /*
  457.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  458.         be written in or called from a high-level language without the help of
  459.         mixed mode or assembly glue.
  460.  
  461.             typedef pascal void (*AttnRoutineProcPtr)(short sessRefnum, short attnBytes);
  462.  
  463.         In:
  464.          => sessRefnum      D0.W
  465.          => attnBytes       D1.W
  466. */
  467.  
  468. #if GENERATINGCFM
  469. typedef UniversalProcPtr MPPCompletionUPP;
  470. typedef UniversalProcPtr ATPCompletionUPP;
  471. typedef UniversalProcPtr XPPCompletionUPP;
  472. typedef UniversalProcPtr AttnRoutineUPP;
  473. #else
  474. typedef Register68kProcPtr MPPCompletionUPP;
  475. typedef Register68kProcPtr ATPCompletionUPP;
  476. typedef Register68kProcPtr XPPCompletionUPP;
  477. typedef Register68kProcPtr AttnRoutineUPP;
  478. #endif
  479.  
  480. struct WDSElement {
  481.     short                            entryLength;
  482.     Ptr                                entryPtr;
  483. };
  484. typedef struct WDSElement WDSElement;
  485.  
  486. struct NTElement {
  487.     AddrBlock                        nteAddress;                    /*network address of entity*/
  488.     SInt8                            filler;
  489.     SInt8                            entityData[99];                /*Object, Type & Zone*/
  490. };
  491. typedef struct NTElement NTElement;
  492.  
  493. struct NamesTableEntry {
  494.     Ptr                                qNext;                        /*ptr to next NTE*/
  495.     NTElement                        nt;
  496. };
  497. typedef struct NamesTableEntry NamesTableEntry;
  498.  
  499. #define XPPPBHeader             \
  500.     QElem *qLink;                \
  501.     short qType;                \
  502.     short ioTrap;                \
  503.     Ptr ioCmdAddr;                \
  504.     XPPCompletionUPP ioCompletion; \
  505.     OSErr ioResult;                \
  506.     long cmdResult;                \
  507.     short ioVRefNum;            \
  508.     short ioRefNum;                \
  509.     short csCode;
  510. typedef Boolean (*MPPProtocolHandlerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, short numBytesLeftToReadInPacket);
  511. typedef Boolean (*DDPSocketListenerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, UInt8 packetDestinationNumber, short numBytesLeftToReadInPacket);
  512.  
  513. #if GENERATINGCFM
  514. typedef UniversalProcPtr MPPProtocolHandlerUPP;
  515. typedef UniversalProcPtr DDPSocketListenerUPP;
  516. #else
  517. typedef Register68kProcPtr MPPProtocolHandlerUPP;
  518. typedef Register68kProcPtr DDPSocketListenerUPP;
  519. #endif
  520.  
  521. struct MPPparms {
  522.     QElem                            *qLink;
  523.     short                            qType;
  524.     short                            ioTrap;
  525.     Ptr                                ioCmdAddr;
  526.     ATPCompletionUPP                ioCompletion;
  527.     OSErr                            ioResult;
  528.     long                            userData;
  529.     short                            reqTID;
  530.     short                            ioRefNum;
  531.     short                            csCode;
  532. };
  533. typedef struct MPPparms MPPparms;
  534.  
  535. struct LAPparms {
  536.     QElem                            *qLink;
  537.     short                            qType;
  538.     short                            ioTrap;
  539.     Ptr                                ioCmdAddr;
  540.     ATPCompletionUPP                ioCompletion;
  541.     OSErr                            ioResult;
  542.     long                            userData;
  543.     short                            reqTID;
  544.     short                            ioRefNum;
  545.     short                            csCode;
  546.     UInt8                            protType;                    /*ALAP protocol Type */
  547.     UInt8                            filler;
  548.     union {
  549.         Ptr                                wdsPointer;                /*-> write data structure*/
  550.         MPPProtocolHandlerUPP            handler;                /*-> protocol handler routine*/
  551.     } u;
  552. };
  553.  
  554. typedef struct LAPparms LAPparms;
  555.  
  556. struct DDPparms {
  557.     QElem                            *qLink;
  558.     short                            qType;
  559.     short                            ioTrap;
  560.     Ptr                                ioCmdAddr;
  561.     ATPCompletionUPP                ioCompletion;
  562.     OSErr                            ioResult;
  563.     long                            userData;
  564.     short                            reqTID;
  565.     short                            ioRefNum;
  566.     short                            csCode;
  567.     UInt8                            socket;                        /*socket number */
  568.     UInt8                            checksumFlag;                /*check sum flag */
  569.     union {
  570.         Ptr                                wdsPointer;                /*-> write data structure*/
  571.         DDPSocketListenerUPP            listener;                /*->write data structure or -> Listener*/
  572.     } u;
  573. };
  574.  
  575. typedef struct DDPparms DDPparms;
  576.  
  577. union NBPPtrs {
  578.     Ptr                                ntQElPtr;
  579.     Ptr                                entityPtr;
  580. };
  581. typedef union NBPPtrs NBPPtrs;
  582.  
  583. union LookupConfirmParams {
  584.     UInt8                            verifyFlag;
  585.     struct {
  586.         Ptr                                retBuffPtr;
  587.         short                            retBuffSize;
  588.         short                            maxToGet;
  589.         short                            numGotten;
  590.     }                                Lookup;
  591.     struct {
  592.         AddrBlock                        confirmAddr;
  593.         UInt8                            newSocket;
  594.         UInt8                            filler;                    /*    Filler for proper byte alignment*/
  595.     }                                Confirm;
  596. };
  597. typedef union LookupConfirmParams LookupConfirmParams;
  598.  
  599. struct NBPparms {
  600.     QElem                            *qLink;
  601.     short                            qType;
  602.     short                            ioTrap;
  603.     Ptr                                ioCmdAddr;
  604.     ATPCompletionUPP                ioCompletion;
  605.     OSErr                            ioResult;
  606.     long                            userData;
  607.     short                            reqTID;
  608.     short                            ioRefNum;
  609.     short                            csCode;
  610.     UInt8                            interval;                    /*retry interval */
  611.     UInt8                            count;                        /*retry count */
  612.     NBPPtrs                            nbpPtrs;
  613.     LookupConfirmParams                parm;
  614. };
  615. typedef struct NBPparms NBPparms;
  616.  
  617. struct SetSelfparms {
  618.     QElem                            *qLink;
  619.     short                            qType;
  620.     short                            ioTrap;
  621.     Ptr                                ioCmdAddr;
  622.     ATPCompletionUPP                ioCompletion;
  623.     OSErr                            ioResult;
  624.     long                            userData;
  625.     short                            reqTID;
  626.     short                            ioRefNum;
  627.     short                            csCode;
  628.     UInt8                            newSelfFlag;                /*self-send toggle flag */
  629.     UInt8                            oldSelfFlag;                /*previous self-send state */
  630. };
  631. typedef struct SetSelfparms SetSelfparms;
  632.  
  633. struct NBPKillparms {
  634.     QElem                            *qLink;
  635.     short                            qType;
  636.     short                            ioTrap;
  637.     Ptr                                ioCmdAddr;
  638.     ATPCompletionUPP                ioCompletion;
  639.     OSErr                            ioResult;
  640.     long                            userData;
  641.     short                            reqTID;
  642.     short                            ioRefNum;
  643.     short                            csCode;
  644.     Ptr                                nKillQEl;                    /*ptr to i/o queue element to cancel */
  645. };
  646. typedef struct NBPKillparms NBPKillparms;
  647.  
  648. struct GetAppleTalkInfoParm {
  649.     QElem                            *qLink;
  650.     short                            qType;
  651.     short                            ioTrap;
  652.     Ptr                                ioCmdAddr;
  653.     ATPCompletionUPP                ioCompletion;
  654.     OSErr                            ioResult;
  655.     long                            userData;
  656.     short                            reqTID;
  657.     short                            ioRefNum;
  658.     short                            csCode;
  659.     short                            version;
  660.     Ptr                                varsPtr;
  661.     Ptr                                DCEPtr;
  662.     short                            portID;
  663.     long                            configuration;
  664.     short                            selfSend;
  665.     short                            netLo;
  666.     short                            netHi;
  667.     long                            ourAdd;
  668.     long                            routerAddr;
  669.     short                            numOfPHs;
  670.     short                            numOfSkts;
  671.     short                            numNBPEs;
  672.     Ptr                                nTQueue;
  673.     short                            LAlength;
  674.     Ptr                                linkAddr;
  675.     Ptr                                zoneName;
  676. };
  677. typedef struct GetAppleTalkInfoParm GetAppleTalkInfoParm;
  678.  
  679. struct ATalkClosePrepParm {
  680.     QElem                            *qLink;
  681.     short                            qType;
  682.     short                            ioTrap;
  683.     Ptr                                ioCmdAddr;
  684.     ATPCompletionUPP                ioCompletion;
  685.     OSErr                            ioResult;
  686.     long                            userData;
  687.     short                            reqTID;
  688.     short                            ioRefNum;
  689.     short                            csCode;
  690.     Ptr                                appName;                    /*pointer to application name in buffer*/
  691. };
  692. typedef struct ATalkClosePrepParm ATalkClosePrepParm;
  693.  
  694. union MPPParamBlock {
  695.     MPPparms                        MPP;                        /*General MPP parms*/
  696.     LAPparms                        LAP;                        /*ALAP calls*/
  697.     DDPparms                        DDP;                        /*DDP calls*/
  698.     NBPparms                        NBP;                        /*NBP calls*/
  699.     SetSelfparms                    SETSELF;
  700.     NBPKillparms                    NBPKILL;
  701.     GetAppleTalkInfoParm            GAIINFO;
  702.     ATalkClosePrepParm                ATALKCLOSE;
  703. };
  704. struct XPPPrmBlk {
  705.     QElem                            *qLink;
  706.     short                            qType;
  707.     short                            ioTrap;
  708.     Ptr                                ioCmdAddr;
  709.     XPPCompletionUPP                ioCompletion;
  710.     OSErr                            ioResult;
  711.     long                            cmdResult;
  712.     short                            ioVRefNum;
  713.     short                            ioRefNum;
  714.     short                            csCode;
  715.     short                            sessRefnum;
  716.     UInt8                            aspTimeout;
  717.     UInt8                            aspRetry;
  718.     short                            cbSize;
  719.     Ptr                                cbPtr;
  720.     short                            rbSize;
  721.     Ptr                                rbPtr;
  722.     short                            wdSize;
  723.     Ptr                                wdPtr;
  724.     UInt8                            ccbStart[296];
  725. };
  726. typedef struct XPPPrmBlk XPPPrmBlk;
  727.  
  728. struct ASPGetparmsBlk {
  729.     QElem                            *qLink;
  730.     short                            qType;
  731.     short                            ioTrap;
  732.     Ptr                                ioCmdAddr;
  733.     XPPCompletionUPP                ioCompletion;
  734.     OSErr                            ioResult;
  735.     long                            cmdResult;
  736.     short                            ioVRefNum;
  737.     short                            ioRefNum;
  738.     short                            csCode;
  739.     short                            aspMaxCmdSize;
  740.     short                            aspQuantumSize;
  741.     short                            numSesss;
  742. };
  743. typedef struct ASPGetparmsBlk ASPGetparmsBlk;
  744.  
  745. struct ASPAbortPrm {
  746.     QElem                            *qLink;
  747.     short                            qType;
  748.     short                            ioTrap;
  749.     Ptr                                ioCmdAddr;
  750.     XPPCompletionUPP                ioCompletion;
  751.     OSErr                            ioResult;
  752.     long                            cmdResult;
  753.     short                            ioVRefNum;
  754.     short                            ioRefNum;
  755.     short                            csCode;
  756.     Ptr                                abortSCBPtr;                /*SCB pointer for AbortOS */
  757. };
  758. typedef struct ASPAbortPrm ASPAbortPrm;
  759.  
  760. struct ASPOpenPrm {
  761.     QElem                            *qLink;
  762.     short                            qType;
  763.     short                            ioTrap;
  764.     Ptr                                ioCmdAddr;
  765.     XPPCompletionUPP                ioCompletion;
  766.     OSErr                            ioResult;
  767.     long                            cmdResult;
  768.     short                            ioVRefNum;
  769.     short                            ioRefNum;
  770.     short                            csCode;
  771.     short                            sessRefnum;
  772.     UInt8                            aspTimeout;
  773.     UInt8                            aspRetry;
  774.     AddrBlock                        serverAddr;
  775.     Ptr                                scbPointer;
  776.     AttnRoutineUPP                    attnRoutine;
  777. };
  778. typedef struct ASPOpenPrm ASPOpenPrm, *ASPOpenPrmPtr;
  779.  
  780. struct AFPLoginPrm {
  781.     QElem                            *qLink;
  782.     short                            qType;
  783.     short                            ioTrap;
  784.     Ptr                                ioCmdAddr;
  785.     XPPCompletionUPP                ioCompletion;
  786.     OSErr                            ioResult;
  787.     long                            cmdResult;
  788.     short                            ioVRefNum;
  789.     short                            ioRefNum;
  790.     short                            csCode;
  791.     short                            sessRefnum;
  792.     UInt8                            aspTimeout;
  793.     UInt8                            aspRetry;
  794.     short                            cbSize;
  795.     Ptr                                cbPtr;
  796.     short                            rbSize;
  797.     Ptr                                rbPtr;
  798.     AddrBlock                        afpAddrBlock;
  799.     Ptr                                afpSCBPtr;
  800.     Ptr                                afpAttnRoutine;
  801.     UInt8                            ccbFill[144];                /*CCB memory allocated for driver  Login needs only 150 bytes BUT CCB really starts in the middle of AFPSCBPtr and also clobbers AFPAttnRoutine. */
  802. };
  803. typedef struct AFPLoginPrm AFPLoginPrm;
  804.  
  805. struct XCallParam {
  806.     QElem                            *qLink;
  807.     short                            qType;
  808.     short                            ioTrap;
  809.     Ptr                                ioCmdAddr;
  810.     XPPCompletionUPP                ioCompletion;
  811.     OSErr                            ioResult;
  812.     long                            cmdResult;
  813.     short                            ioVRefNum;
  814.     short                            ioRefNum;
  815.     short                            csCode;
  816.     short                            xppSubCode;
  817.     UInt8                            xppTimeout;
  818.     UInt8                            xppRetry;
  819.     short                            filler1;
  820.     Ptr                                zipBuffPtr;
  821.     short                            zipNumZones;
  822.     UInt8                            zipLastFlag;
  823.     UInt8                            filler2;
  824.     UInt8                            zipInfoField[70];
  825. };
  826. typedef struct XCallParam XCallParam;
  827.  
  828. union XPPParamBlock {
  829.     XPPPrmBlk                        XPP;
  830.     ASPGetparmsBlk                    GETPARM;
  831.     ASPAbortPrm                        ABORT;
  832.     ASPOpenPrm                        OPEN;
  833.     AFPLoginPrm                        LOGIN;
  834.     XCallParam                        XCALL;
  835. };
  836. #define MOREATPHeader             \
  837.     UInt8 atpSocket;                \
  838.     UInt8 atpFlags;                \
  839.     AddrBlock addrBlock;            \
  840.     short reqLength;                \
  841.     Ptr reqPointer;                \
  842.     Ptr bdsPointer;
  843. struct ATPparms {
  844.     QElem                            *qLink;
  845.     short                            qType;
  846.     short                            ioTrap;
  847.     Ptr                                ioCmdAddr;
  848.     ATPCompletionUPP                ioCompletion;
  849.     OSErr                            ioResult;
  850.     long                            userData;
  851.     short                            reqTID;
  852.     short                            ioRefNum;
  853.     short                            csCode;
  854.     UInt8                            atpSocket;
  855.     UInt8                            atpFlags;
  856.     AddrBlock                        addrBlock;
  857.     short                            reqLength;
  858.     Ptr                                reqPointer;
  859.     Ptr                                bdsPointer;
  860. };
  861. typedef struct ATPparms ATPparms;
  862.  
  863. struct SendReqparms {
  864.     QElem                            *qLink;
  865.     short                            qType;
  866.     short                            ioTrap;
  867.     Ptr                                ioCmdAddr;
  868.     ATPCompletionUPP                ioCompletion;
  869.     OSErr                            ioResult;
  870.     long                            userData;
  871.     short                            reqTID;
  872.     short                            ioRefNum;
  873.     short                            csCode;
  874.     UInt8                            atpSocket;
  875.     UInt8                            atpFlags;
  876.     AddrBlock                        addrBlock;
  877.     short                            reqLength;
  878.     Ptr                                reqPointer;
  879.     Ptr                                bdsPointer;
  880.     UInt8                            numOfBuffs;
  881.     UInt8                            timeOutVal;
  882.     UInt8                            numOfResps;
  883.     UInt8                            retryCount;
  884.     short                            intBuff;
  885.     UInt8                            TRelTime;
  886.     SInt8                            filler0;
  887. };
  888. typedef struct SendReqparms SendReqparms;
  889.  
  890. struct ATPmisc1 {
  891.     QElem                            *qLink;
  892.     short                            qType;
  893.     short                            ioTrap;
  894.     Ptr                                ioCmdAddr;
  895.     ATPCompletionUPP                ioCompletion;
  896.     OSErr                            ioResult;
  897.     long                            userData;
  898.     short                            reqTID;
  899.     short                            ioRefNum;
  900.     short                            csCode;
  901.     UInt8                            atpSocket;
  902.     UInt8                            atpFlags;
  903.     AddrBlock                        addrBlock;
  904.     short                            reqLength;
  905.     Ptr                                reqPointer;
  906.     Ptr                                bdsPointer;
  907.     union {
  908.         UInt8                            bitMap;                    /*bitmap received */
  909.         UInt8                            numOfBuffs;                /*number of responses being sent*/
  910.         UInt8                            rspNum;                    /*sequence number*/
  911.     } u;
  912. };
  913.  
  914. typedef struct ATPmisc1 ATPmisc1;
  915.  
  916. struct ATPmisc2 {
  917.     QElem                            *qLink;
  918.     short                            qType;
  919.     short                            ioTrap;
  920.     Ptr                                ioCmdAddr;
  921.     ATPCompletionUPP                ioCompletion;
  922.     OSErr                            ioResult;
  923.     long                            userData;
  924.     short                            reqTID;
  925.     short                            ioRefNum;
  926.     short                            csCode;
  927.     UInt8                            atpSocket;
  928.     UInt8                            atpFlags;
  929.     AddrBlock                        addrBlock;
  930.     short                            reqLength;
  931.     Ptr                                reqPointer;
  932.     Ptr                                bdsPointer;
  933.     UInt8                            filler;
  934.     UInt8                            bdsSize;
  935.     short                            transID;
  936. };
  937. typedef struct ATPmisc2 ATPmisc2;
  938.  
  939. struct Killparms {
  940.     QElem                            *qLink;
  941.     short                            qType;
  942.     short                            ioTrap;
  943.     Ptr                                ioCmdAddr;
  944.     ATPCompletionUPP                ioCompletion;
  945.     OSErr                            ioResult;
  946.     long                            userData;
  947.     short                            reqTID;
  948.     short                            ioRefNum;
  949.     short                            csCode;
  950.     UInt8                            atpSocket;
  951.     UInt8                            atpFlags;
  952.     AddrBlock                        addrBlock;
  953.     short                            reqLength;
  954.     Ptr                                reqPointer;
  955.     Ptr                                bdsPointer;
  956.     Ptr                                aKillQEl;
  957. };
  958. typedef struct Killparms Killparms;
  959.  
  960. union ATPParamBlock {
  961.     ATPparms                        ATP;                        /*General ATP parms*/
  962.     SendReqparms                    SREQ;                        /*sendrequest parms*/
  963.     ATPmisc1                        OTH1;                        /*and a few others*/
  964.     ATPmisc2                        OTH2;                        /*and a few others*/
  965.     Killparms                        KILL;                        /*and a few others*/
  966. };
  967.  
  968. #if GENERATINGCFM
  969. #else
  970. #endif
  971.  
  972. enum {
  973.     uppATalkTransitionEventProcInfo = kCStackBased
  974.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  975.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  976.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ATQEntryPtr)))
  977.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*))),
  978.     uppMPPCompletionProcInfo = kRegisterBased
  979.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(MPPPBPtr))),
  980.     uppATPCompletionProcInfo = kRegisterBased
  981.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(ATPPBPtr))),
  982.     uppXPPCompletionProcInfo = kRegisterBased
  983.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(XPPParmBlkPtr))),
  984.     uppAttnRoutineProcInfo = kRegisterBased
  985.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
  986.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterD1, SIZE_CODE(sizeof(short))),
  987.     uppMPPProtocolHandlerProcInfo = SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ),
  988.     uppDDPSocketListenerProcInfo = SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener )
  989. };
  990.  
  991. #if GENERATINGCFM
  992. #define NewATalkTransitionEventProc(userRoutine)        \
  993.         (ATalkTransitionEventUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, GetCurrentArchitecture())
  994. #define NewMPPCompletionProc(userRoutine)        \
  995.         (MPPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPCompletionProcInfo, GetCurrentArchitecture())
  996. #define NewATPCompletionProc(userRoutine)        \
  997.         (ATPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppATPCompletionProcInfo, GetCurrentArchitecture())
  998. #define NewXPPCompletionProc(userRoutine)        \
  999.         (XPPCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppXPPCompletionProcInfo, GetCurrentArchitecture())
  1000. #define NewAttnRoutineProc(userRoutine)        \
  1001.         (AttnRoutineUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppAttnRoutineProcInfo, GetCurrentArchitecture())
  1002. #define NewMPPProtocolHandlerProc(userRoutine)        \
  1003.         (MPPProtocolHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPProtocolHandlerProcInfo, GetCurrentArchitecture())
  1004. #define NewDDPSocketListenerProc(userRoutine)        \
  1005.         (DDPSocketListenerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDDPSocketListenerProcInfo, GetCurrentArchitecture())
  1006. #else
  1007. #define NewATalkTransitionEventProc(userRoutine)        \
  1008.         ((ATalkTransitionEventUPP) (userRoutine))
  1009. #define NewMPPCompletionProc(userRoutine)        \
  1010.         ((MPPCompletionUPP) (userRoutine))
  1011. #define NewATPCompletionProc(userRoutine)        \
  1012.         ((ATPCompletionUPP) (userRoutine))
  1013. #define NewXPPCompletionProc(userRoutine)        \
  1014.         ((XPPCompletionUPP) (userRoutine))
  1015. #define NewAttnRoutineProc(userRoutine)        \
  1016.         ((AttnRoutineUPP) (userRoutine))
  1017. #define NewMPPProtocolHandlerProc(userRoutine)        \
  1018.         ((MPPProtocolHandlerUPP) (userRoutine))
  1019. #define NewDDPSocketListenerProc(userRoutine)        \
  1020.         ((DDPSocketListenerUPP) (userRoutine))
  1021. #endif
  1022.  
  1023. #if GENERATINGCFM
  1024. #define CallATalkTransitionEventProc(userRoutine, eventCode, qElem, eventParameter)        \
  1025.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, (eventCode), (qElem), (eventParameter))
  1026. #define CallMPPCompletionProc(userRoutine, thePBptr)        \
  1027.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMPPCompletionProcInfo, (thePBptr))
  1028. #define CallATPCompletionProc(userRoutine, thePBptr)        \
  1029.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppATPCompletionProcInfo, (thePBptr))
  1030. #define CallXPPCompletionProc(userRoutine, thePBptr)        \
  1031.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppXPPCompletionProcInfo, (thePBptr))
  1032. #define CallAttnRoutineProc(userRoutine, sessRefnum, attnBytes)        \
  1033.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppAttnRoutineProcInfo, (sessRefnum), (attnBytes))
  1034. #define CallMPPProtocolHandlerProc(userRoutine, SCCAddr1, SCCAddr2, MPPLocalVars, nextFreeByteInRHA, ReadPacketAndReadRestPtr, numBytesLeftToReadInPacket)        \
  1035.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMPPProtocolHandlerProcInfo, (SCCAddr1), (SCCAddr2), (MPPLocalVars), (nextFreeByteInRHA), (ReadPacketAndReadRestPtr), (numBytesLeftToReadInPacket))
  1036. #define CallDDPSocketListenerProc(userRoutine, SCCAddr1, SCCAddr2, MPPLocalVars, nextFreeByteInRHA, ReadPacketAndReadRestPtr, packetDestinationNumber, numBytesLeftToReadInPacket)        \
  1037.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDDPSocketListenerProcInfo, (SCCAddr1), (SCCAddr2), (MPPLocalVars), (nextFreeByteInRHA), (ReadPacketAndReadRestPtr), (packetDestinationNumber), (numBytesLeftToReadInPacket))
  1038. #else
  1039. #define CallATalkTransitionEventProc(userRoutine, eventCode, qElem, eventParameter)        \
  1040.         (*(userRoutine))((eventCode), (qElem), (eventParameter))
  1041. /* (*MPPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1042. /* (*ATPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1043. /* (*XPPCompletionProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1044. /* (*AttnRoutineProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1045. /* (*MPPProtocolHandlerProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1046. /* (*DDPSocketListenerProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  1047. #endif
  1048.  
  1049. extern pascal OSErr OpenXPP(short *xppRefnum);
  1050. extern pascal OSErr ASPOpenSession(XPPParmBlkPtr thePBptr, Boolean async);
  1051. extern pascal OSErr ASPCloseSession(XPPParmBlkPtr thePBptr, Boolean async);
  1052. extern pascal OSErr ASPAbortOS(XPPParmBlkPtr thePBptr, Boolean async);
  1053. extern pascal OSErr ASPGetParms(XPPParmBlkPtr thePBptr, Boolean async);
  1054. extern pascal OSErr ASPCloseAll(XPPParmBlkPtr thePBptr, Boolean async);
  1055. extern pascal OSErr ASPUserWrite(XPPParmBlkPtr thePBptr, Boolean async);
  1056. extern pascal OSErr ASPUserCommand(XPPParmBlkPtr thePBptr, Boolean async);
  1057. extern pascal OSErr ASPGetStatus(XPPParmBlkPtr thePBptr, Boolean async);
  1058. #define ASPGetStatusSync(paramBlock) ASPGetStatus((paramBlock), FALSE)
  1059. extern pascal OSErr AFPCommand(XPPParmBlkPtr thePBptr, Boolean async);
  1060. extern pascal OSErr GetLocalZones(XPPParmBlkPtr thePBptr, Boolean async);
  1061. extern pascal OSErr GetZoneList(XPPParmBlkPtr thePBptr, Boolean async);
  1062. extern pascal OSErr GetMyZone(XPPParmBlkPtr thePBptr, Boolean async);
  1063. extern pascal OSErr PAttachPH(MPPPBPtr thePBptr, Boolean async);
  1064. extern pascal OSErr PDetachPH(MPPPBPtr thePBptr, Boolean async);
  1065. extern pascal OSErr PWriteLAP(MPPPBPtr thePBptr, Boolean async);
  1066. extern pascal OSErr POpenSkt(MPPPBPtr thePBptr, Boolean async);
  1067. extern pascal OSErr PCloseSkt(MPPPBPtr thePBptr, Boolean async);
  1068. extern pascal OSErr PWriteDDP(MPPPBPtr thePBptr, Boolean async);
  1069. extern pascal OSErr PRegisterName(MPPPBPtr thePBptr, Boolean async);
  1070. extern pascal OSErr PLookupName(MPPPBPtr thePBptr, Boolean async);
  1071. #define PLookupNameSync(paramBlock) PLookupName((paramBlock), FALSE)
  1072. extern pascal OSErr PConfirmName(MPPPBPtr thePBptr, Boolean async);
  1073. extern pascal OSErr PRemoveName(MPPPBPtr thePBptr, Boolean async);
  1074. extern pascal OSErr PSetSelfSend(MPPPBPtr thePBptr, Boolean async);
  1075. extern pascal OSErr PKillNBP(MPPPBPtr thePBptr, Boolean async);
  1076. extern pascal OSErr PGetAppleTalkInfo(MPPPBPtr thePBptr, Boolean async);
  1077. extern pascal OSErr PATalkClosePrep(MPPPBPtr thePBptr, Boolean async);
  1078. extern pascal OSErr POpenATPSkt(ATPPBPtr thePBptr, Boolean async);
  1079. extern pascal OSErr PCloseATPSkt(ATPPBPtr thePBPtr, Boolean async);
  1080. extern pascal OSErr PSendRequest(ATPPBPtr thePBPtr, Boolean async);
  1081. extern pascal OSErr PGetRequest(ATPPBPtr thePBPtr, Boolean async);
  1082. extern pascal OSErr PSendResponse(ATPPBPtr thePBPtr, Boolean async);
  1083. extern pascal OSErr PAddResponse(ATPPBPtr thePBPtr, Boolean async);
  1084. extern pascal OSErr PRelTCB(ATPPBPtr thePBPtr, Boolean async);
  1085. extern pascal OSErr PRelRspCB(ATPPBPtr thePBPtr, Boolean async);
  1086. extern pascal OSErr PNSendRequest(ATPPBPtr thePBPtr, Boolean async);
  1087. extern pascal OSErr PKillSendReq(ATPPBPtr thePBPtr, Boolean async);
  1088. extern pascal OSErr PKillGetReq(ATPPBPtr thePBPtr, Boolean async);
  1089. extern pascal OSErr ATPKillAllGetReq(ATPPBPtr thePBPtr, Boolean async);
  1090. extern pascal void BuildLAPwds(Ptr wdsPtr, Ptr dataPtr, short destHost, short prototype, short frameLen);
  1091. extern pascal void BuildDDPwds(Ptr wdsPtr, Ptr headerPtr, Ptr dataPtr, AddrBlock netAddr, short ddpType, short dataLen);
  1092. extern pascal void NBPSetEntity(Ptr buffer, ConstStr32Param nbpObject, ConstStr32Param nbpType, ConstStr32Param nbpZone);
  1093. extern pascal void NBPSetNTE(Ptr ntePtr, ConstStr32Param nbpObject, ConstStr32Param nbpType, ConstStr32Param nbpZone, short socket);
  1094. extern pascal short GetBridgeAddress(void);
  1095. extern pascal short BuildBDS(Ptr buffPtr, Ptr bdsPtr, short buffSize);
  1096. extern pascal OSErr MPPOpen(void);
  1097. extern pascal OSErr LAPAddATQ(ATQEntryPtr theATQEntry);
  1098. extern pascal OSErr LAPRmvATQ(ATQEntryPtr theATQEntry);
  1099. extern pascal OSErr ATPLoad(void);
  1100. extern pascal OSErr ATPUnload(void);
  1101. extern pascal OSErr NBPExtract(Ptr theBuffer, short numInBuf, short whichOne, EntityName *abEntity, AddrBlock *address);
  1102. extern pascal OSErr GetNodeAddress(short *myNode, short *myNet);
  1103. extern pascal Boolean IsMPPOpen(void);
  1104. extern pascal Boolean IsATPOpen(void);
  1105. extern pascal void ATEvent(long event, Ptr infoPtr);
  1106. extern pascal OSErr ATPreFlightEvent(long event, long cancel, Ptr infoPtr);
  1107. /*
  1108.     The following routines are obsolete and will not be supported on
  1109.     PowerPC. Equivalent functionality is provided by the routines
  1110.     above.
  1111. */
  1112. #if OLDROUTINENAMES && !GENERATINGCFM
  1113. extern pascal OSErr MPPClose(void);
  1114. extern pascal OSErr LAPOpenProtocol(ABByte theLAPType, Ptr protoPtr);
  1115. extern pascal OSErr LAPCloseProtocol(ABByte theLAPType);
  1116. extern pascal OSErr LAPWrite(ATLAPRecHandle abRecord, Boolean async);
  1117. extern pascal OSErr LAPRead(ATLAPRecHandle abRecord, Boolean async);
  1118. extern pascal OSErr LAPRdCancel(ATLAPRecHandle abRecord);
  1119. extern pascal OSErr DDPOpenSocket(short *theSocket, Ptr sktListener);
  1120. extern pascal OSErr DDPCloseSocket(short theSocket);
  1121. extern pascal OSErr DDPRead(ATDDPRecHandle abRecord, Boolean retCksumErrs, Boolean async);
  1122. extern pascal OSErr DDPWrite(ATDDPRecHandle abRecord, Boolean doChecksum, Boolean async);
  1123. extern pascal OSErr DDPRdCancel(ATDDPRecHandle abRecord);
  1124. extern pascal OSErr ATPOpenSocket(AddrBlock addrRcvd, short *atpSocket);
  1125. extern pascal OSErr ATPCloseSocket(short atpSocket);
  1126. extern pascal OSErr ATPSndRequest(ATATPRecHandle abRecord, Boolean async);
  1127. extern pascal OSErr ATPRequest(ATATPRecHandle abRecord, Boolean async);
  1128. extern pascal OSErr ATPReqCancel(ATATPRecHandle abRecord, Boolean async);
  1129. extern pascal OSErr ATPGetRequest(ATATPRecHandle abRecord, Boolean async);
  1130. extern pascal OSErr ATPSndRsp(ATATPRecHandle abRecord, Boolean async);
  1131. extern pascal OSErr ATPAddRsp(ATATPRecHandle abRecord);
  1132. extern pascal OSErr ATPResponse(ATATPRecHandle abRecord, Boolean async);
  1133. extern pascal OSErr ATPRspCancel(ATATPRecHandle abRecord, Boolean async);
  1134. extern pascal OSErr NBPRegister(ATNBPRecHandle abRecord, Boolean async);
  1135. extern pascal OSErr NBPLookup(ATNBPRecHandle abRecord, Boolean async);
  1136. extern pascal OSErr NBPConfirm(ATNBPRecHandle abRecord, Boolean async);
  1137. extern pascal OSErr NBPRemove(EntityPtr abEntity);
  1138. extern pascal OSErr NBPLoad(void);
  1139. extern pascal OSErr NBPUnload(void);
  1140. #endif
  1141.  
  1142. #if PRAGMA_IMPORT_SUPPORTED
  1143. #pragma import off
  1144. #endif
  1145.  
  1146. #if PRAGMA_ALIGN_SUPPORTED
  1147. #pragma options align=reset
  1148. #endif
  1149.  
  1150. #ifdef __cplusplus
  1151. }
  1152. #endif
  1153.  
  1154. #endif /* __APPLETALK__ */
  1155.